<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCartTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        if(!Schema::HasTable('cart'))
        {
            Schema::create('cart', function (Blueprint $table){
                $table->increments('cart_id');
                $table->integer('users_id');
                $table->integer('goods_id');
                $table->integer('num')->default(1);
                $table->timestamps();  
            });
        }
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        // Schema::drop('cart');
    }
}
